GetLast Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Returns the last item in the bag: the item that would appear last if the bag was enumerated. This is also the largest item in the bag.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public T GetLast()
Visual Basic (Declaration)
Public Function GetLast As T
Visual C++
public:
T GetLast ()

Return Value

The last item in the bag. If more than one item is largest, the last one added is returned.

Remarks

GetLast() takes time O(log N), where N is the number of items in the bag.

Exceptions

ExceptionCondition
System..::InvalidOperationExceptionThe bag is empty.

See Also